package com.bbf.springmvcdemo.entity;

import com.bbf.springmvcdemo.feature.BaseBean;
import org.apache.commons.lang3.StringUtils;

/**
 * 用于JSON测试的DTO
 * @author BBF
 */
public class WebDto extends BaseBean {
  private static final long serialVersionUID = 1084542298371395580L;

  private String userName;
  private String userPwd;

  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public String getUserPwd() {
    return userPwd;
  }

  public void setUserPwd(String userPwd) {
    this.userPwd = userPwd;
  }

  /**
   * 判断是否关键值为空
   * @param dto dto对象
   * @return 不为空-true
   */
  public static boolean isAllBlank(WebDto dto) {
    return null != dto && StringUtils.isAllBlank(dto.getUserName(), dto.getUserPwd());
  }
}
